<article class="" id="post-">
<header class="entry-header">
<h1 class="entry-title">.pushStack()</h1>
<div class="entry-meta">
						所属分类：<span class="category"><a href="/category/internals/">内部函数</a></span>
<span class="pull-right">英文文档：<a href="https://api.jquery123.com/pushStack/" target="_blank">.pushStack()</a></span>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<!-- .entry-header -->
<div class="entry-content">
<article class="entry method" id="pushStack1"><h2 class="section-title">
<span class="name">.pushStack( elements )</span><span class="returns">返回: <a href="/Types/#jQuery">jQuery</a></span>
</h2>
<div class="entry-wrapper">
<p class="desc"><strong>描述: </strong>将一个DOM元素集合加入到jQuery栈。
			
			</p>
<ul class="signatures">
<li class="signature" id="pushStack-elements">
<h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.0/">1.0</a></span>.pushStack( elements )</h4>
<ul><li>
<div><strong>elements</strong></div>
<div>类型: <a href="/Types/#Array">Array</a>
</div>
<div>将要压入jQuery栈的元素，用于生成一个新的jQuery对象。</div>
</li></ul>
</li>
<li class="signature" id="pushStack-elements-name-arguments">
<h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.3/">1.3</a></span>.pushStack( elements, name, arguments )</h4>
<ul>
<li>
<div><strong>elements</strong></div>
<div>类型: <a href="/Types/#Array">Array</a>
</div>
<div>将要压入jQuery栈的元素，用于生成一个新的jQuery对象。</div>
</li>
<li>
<div><strong>name</strong></div>
<div>类型: <a href="/Types/#String">String</a>
</div>
<div>将要压入jQuery栈的元素，用于生成一个新的jQuery对象。</div>
</li>
<li>
<div><strong>arguments</strong></div>
<div>类型: <a href="/Types/#Array">Array</a>
</div>
<div>传递给jQuery方法的参数(用于序列化)。</div>
</li>
</ul>
</li>
</ul>
<section class="entry-examples" id="entry-examples"><header><h2 class="underline">例子:</h2></header><div class="entry-example" id="example-0">
<h4><span class="desc">向 jQuery 栈中先压入一些元素，然后再删除它们，之后再退回到之前刚压入栈的状态。</span></h4>
<div class="syntaxhighlighter javascript ">
<table>
<tbody>
<tr>
<td class="gutter">
<div class="line n1">1</div>
<div class="line n2">2</div>
<div class="line n3">3</div>
<div class="line n4">4</div>
</td>
<td class="code">
<pre><div class="container"><div class="line"><code>jQuery([])</code></div></div><div class="container"><div class="line"><code>    .pushStack( document.getElementsByTagName(<span class="string">"div"</span>) )</code></div></div><div class="container"><div class="line"><code>        .remove()</code></div></div><div class="container"><div class="line"><code>    .end();</code></div></div></pre>
</td>
</tr>
</tbody>
</table>
</div>
</div></section>
</div></article> </div>
</article>